package com.zj.designpattern.decorator;

public class Test {
    /**
     * 测试类
     *
     * @param args
     */

    public static void main(String[] args) {
        //新建一个原味手抓饼类
        Shreddedcake sh = new Shreddedcake();

        System.out.print(sh.descripestion());

        System.out.println(" 价格： " + sh.money());

        //新建一个鸡蛋类，附加鸡蛋属性到手抓饼上
        EggshrededCake egg = new EggshrededCake(sh);

        System.out.print(egg.descripestion());

        System.out.println(" 价格：" + egg.money());

        //新建一个牛肉类，附加牛肉属性到手抓饼上
        Beffshredded beff = new Beffshredded(egg);

        System.out.print(beff.descripestion());

        System.out.println(" 价格：" + beff.money());

        EggshrededCake eggBeff = new EggshrededCake(beff);
        System.out.print(eggBeff.descripestion());

        System.out.println(" 价格：" + eggBeff.money());

    }

}
